<script>
	export default {
		onLaunch: function() {
			console.log('App Launch');
			
			// 检查登录状态
			const isLoggedIn = uni.getStorageSync('isLoggedIn');
			if (!isLoggedIn) {
				// 如果未登录，跳转到登录页
				uni.reLaunch({
					url: '/pages/login/login'
				});
			}
		},
		onShow: function() {
			console.log('App Show');
		},
		onHide: function() {
			console.log('App Hide');
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	
	/* 主要颜色变量 */
	$uni-color-primary: #2979ff;
	$uni-color-success: #18bc37;
	$uni-color-warning: #f3a73f;
	$uni-color-error: #e43d33;
	
	/* 全局样式 */
	/* stylelint-disable selector-type-no-unknown */
	view, text, image, scroll-view, swiper, swiper-item, navigator, button, input, textarea {
		box-sizing: border-box;
	}
	/* stylelint-enable selector-type-no-unknown */
	
	/* stylelint-disable selector-type-no-unknown */
	page {
		background-color: #f7f8fa;
		font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
	}
	/* stylelint-enable selector-type-no-unknown */
	
	button::after {
		border: none;
	}

	/* 全局样式重置 */
	* {
		box-sizing: border-box;
	}

	/* 通用按钮样式 */
	button {
		border: none;
		outline: none;
	}

	/* 通用输入框样式 */
	input, textarea {
		outline: none;
	}

	/* 滚动条样式 */
	::-webkit-scrollbar {
		width: 0;
		height: 0;
		color: transparent;
	}

	/* 通用动画 */
	.fade-in {
		animation: fadeIn 0.3s ease-in-out;
	}

	@keyframes fadeIn {
		from {
			opacity: 0;
			transform: translateY(20rpx);
		}
		to {
			opacity: 1;
			transform: translateY(0);
		}
	}

	/* 通用卡片样式 */
	.card {
		background-color: #fff;
		border-radius: 16rpx;
		box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
	}

	/* 通用间距 */
	.mt-10 { margin-top: 10rpx; }
	.mt-20 { margin-top: 20rpx; }
	.mt-30 { margin-top: 30rpx; }
	.mb-10 { margin-bottom: 10rpx; }
	.mb-20 { margin-bottom: 20rpx; }
	.mb-30 { margin-bottom: 30rpx; }
	.p-10 { padding: 10rpx; }
	.p-20 { padding: 20rpx; }
	.p-30 { padding: 30rpx; }

	/* 通用文本样式 */
	.text-primary { color: #007AFF; }
	.text-success { color: #34C759; }
	.text-warning { color: #FF9500; }
	.text-danger { color: #FF3B30; }
	.text-muted { color: #999; }
	.text-center { text-align: center; }
	.text-bold { font-weight: bold; }

	/* 通用布局 */
	.flex { display: flex; }
	.flex-column { flex-direction: column; }
	.flex-center { justify-content: center; align-items: center; }
	.flex-between { justify-content: space-between; }
	.flex-around { justify-content: space-around; }
	.flex-1 { flex: 1; }

	/* 增强tabBar样式 */
	.uni-tabbar {
		height: 100px !important;
		padding-bottom: 10px !important;
		padding-top: 10px !important;
		box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
	}
	
	.uni-tabbar .uni-tabbar__item {
		height: 80px !important;
		padding: 5px 0 !important;
		flex-direction: column !important;
		justify-content: center !important;
		align-items: center !important;
		position: relative !important;
	}
	
	.uni-tabbar .uni-tabbar__label {
		font-size: 12px !important;
		font-weight: 500 !important;
		line-height: 1.2 !important;
		color: #7A7E83 !important;
	}
	
	/* 选中状态增强效果 */
	.uni-tabbar__item.uni-tabbar__item--active .uni-tabbar__label {
		color: #007AFF !important;
	}
</style> 